博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wpgcms---详情页面数据怎么渲染
阅读量:6880 次
发布时间:2019-06-27

本文共 2055 字,大约阅读时间需要 6 分钟。

wpgcms的详情页面的数据会被保存在 contentInfo 这么一个字段里面。

面包屑导航调用:

当前位置 {

% for c in crumb|slice(1, crumb|length-1) %} {
% if not loop.last %}> {
{ c.name }}
{
% else %}> 新闻详情 {
% endif %}{
% endfor %}

标题,正文,时间的调用:

{
{ contentInfo.title }}

{% autoescape false %} {
{ contentInfo.getBodyInfo() }} {% endautoescape %}
{% set pubtime = contentInfo.publish_time %} 时间:{
{ pubtime|slice(0, 4) }}年{
{ pubtime|slice(5, 2) }}月{
{ pubtime|slice(8, 2) }}日
来源:{
{ contentInfo.source_name|default('金塔集团') }}
阅读:{
{ contentInfo.view_count }}

下一篇,下一篇的调用:

{% set nextInfo = contentInfo.nextInfo %} {% if nextInfo %} 下一篇:{

{ nextInfo.title }} {% endif %}

完整实例:

{% extends 'layout.html' %}{% block pageContent %}

当前位置 {% for c in crumb|slice(1, crumb|length-1) %} {% if not loop.last %}> {

{ c.name }} {% else %}> 新闻详情 {% endif %} {% endfor %}

{
{ contentInfo.title }}

{% autoescape false %} {
{ contentInfo.getBodyInfo() }} {% endautoescape %}
{% set pubtime = contentInfo.publish_time %} 时间:{ { pubtime|slice(0, 4) }}年{ { pubtime|slice(5, 2) }}月{ { pubtime|slice(8, 2) }}日 来源:{ { contentInfo.source_name|default('金塔集团') }} 阅读:{ { contentInfo.view_count }}

{% set nextInfo = contentInfo.nextInfo %} {% if nextInfo %} 下一篇:{

{ nextInfo.title }} {% endif %}

{% endblock %}

 

转载于:https://www.cnblogs.com/e0yu/p/9928409.html

你可能感兴趣的文章
Scala函数的定义的几种写法
查看>>
【iphone应用开发】iphone 应用开发之二:UITextView控件的详细讲解
查看>>
HTML5 API摘要
查看>>
去除滚动条的可滚动效果
查看>>
注入攻击 初见解
查看>>
JProfiler_SN_8_x.txt
查看>>
IntelliJ IDEA 社区版没有 Spring Initializr
查看>>
(C++)从本机获取WMI数据.
查看>>
【Practical API Design学习笔记】修复奥德修斯
查看>>
CentOS镜像使用帮助
查看>>
Spring AOP 实现原理
查看>>
4.5.2 libxml/tree.h file not found解决办法
查看>>
Java反射机制class类
查看>>
android使用proguard混淆生成jar包
查看>>
疯狂Activiti6.0连载(12)DMN规范概述
查看>>
3-Elasticsearch查询API
查看>>
RemotelyAnywhere安装使用指南
查看>>
PHP中利用ICONV转化字符串编码出错【DETECTED AN ILLEGAL CHARAC...
查看>>
display table 标签
查看>>
mysql 日志维护
查看>>